package com.digital.welcome.controller;


import com.digital.welcome.annotation.OperationLog;
import com.digital.welcome.service.CollegeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 韩
 */

@RestController
@RequestMapping("/college")
public class CollegeController {
    @Autowired
    private CollegeService collegeService;

    @ApiOperation(value = "获取所有学院")
    @RequestMapping(value = "/get-all", method = RequestMethod.GET)
    public String getAllCollege() {
        return collegeService.getCollegeList();
    }

    @OperationLog()
    @ApiOperation(value = "新增学院")
    @RequestMapping(value = "/insert", method = RequestMethod.POST)
    public String insertCollege(String college) {
        return collegeService.insertCollege(college);
    }

    @OperationLog()
    @ApiOperation(value = "删除学院")
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public String deleteCollege(String college) {
        return collegeService.deleteCollege(college);
    }


}
